3.1.51 \(\int \frac {\sec ^3(c+d x)}{a+a \cos (c+d x)} \, dx\) [51]

3.1.51.1 Optimal result
3.1.51.2 Mathematica [B] (verified)
3.1.51.3 Rubi [A] (verified)
3.1.51.4 Maple [A] (verified)
3.1.51.5 Fricas [A] (verification not implemented)
3.1.51.6 Sympy [F]
3.1.51.7 Maxima [B] (verification not implemented)
3.1.51.8 Giac [A] (verification not implemented)
3.1.51.9 Mupad [B] (verification not implemented)

3.1.51.1 Optimal result

Integrand size = 21, antiderivative size = 83 \[ \int \frac {\sec ^3(c+d x)}{a+a \cos (c+d x)} \, dx=\frac {3 \text {arctanh}(\sin (c+d x))}{2 a d}-\frac {2 \tan (c+d x)}{a d}+\frac {3 \sec (c+d x) \tan (c+d x)}{2 a d}-\frac {\sec (c+d x) \tan (c+d x)}{d (a+a \cos (c+d x))} \]

output
3/2*arctanh(sin(d*x+c))/a/d-2*tan(d*x+c)/a/d+3/2*sec(d*x+c)*tan(d*x+c)/a/d 
-sec(d*x+c)*tan(d*x+c)/d/(a+a*cos(d*x+c))
 
3.1.51.2 Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(244\) vs. \(2(83)=166\).

Time = 1.17 (sec) , antiderivative size = 244, normalized size of antiderivative = 2.94 \[ \int \frac {\sec ^3(c+d x)}{a+a \cos (c+d x)} \, dx=\frac {\cos \left (\frac {1}{2} (c+d x)\right ) \left (-4 \sec \left (\frac {c}{2}\right ) \sin \left (\frac {d x}{2}\right )+\cos \left (\frac {1}{2} (c+d x)\right ) \left (-6 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+6 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+\frac {1}{\left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}-\frac {1}{\left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}-\frac {4 \sin (d x)}{\left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}\right )\right )}{2 a d (1+\cos (c+d x))} \]

input
Integrate[Sec[c + d*x]^3/(a + a*Cos[c + d*x]),x]
 
output
(Cos[(c + d*x)/2]*(-4*Sec[c/2]*Sin[(d*x)/2] + Cos[(c + d*x)/2]*(-6*Log[Cos 
[(c + d*x)/2] - Sin[(c + d*x)/2]] + 6*Log[Cos[(c + d*x)/2] + Sin[(c + d*x) 
/2]] + (Cos[(c + d*x)/2] - Sin[(c + d*x)/2])^(-2) - (Cos[(c + d*x)/2] + Si 
n[(c + d*x)/2])^(-2) - (4*Sin[d*x])/((Cos[c/2] - Sin[c/2])*(Cos[c/2] + Sin 
[c/2])*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])*(Cos[(c + d*x)/2] + Sin[(c + 
d*x)/2])))))/(2*a*d*(1 + Cos[c + d*x]))
 
3.1.51.3 Rubi [A] (verified)

Time = 0.57 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.01, number of steps used = 12, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.524, Rules used = {3042, 3247, 25, 3042, 3227, 3042, 4254, 24, 4255, 3042, 4257}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\sec ^3(c+d x)}{a \cos (c+d x)+a} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\sin \left (c+d x+\frac {\pi }{2}\right )^3 \left (a \sin \left (c+d x+\frac {\pi }{2}\right )+a\right )}dx\)

\(\Big \downarrow \) 3247

\(\displaystyle -\frac {\int -\left ((3 a-2 a \cos (c+d x)) \sec ^3(c+d x)\right )dx}{a^2}-\frac {\tan (c+d x) \sec (c+d x)}{d (a \cos (c+d x)+a)}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {\int (3 a-2 a \cos (c+d x)) \sec ^3(c+d x)dx}{a^2}-\frac {\tan (c+d x) \sec (c+d x)}{d (a \cos (c+d x)+a)}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\int \frac {3 a-2 a \sin \left (c+d x+\frac {\pi }{2}\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )^3}dx}{a^2}-\frac {\tan (c+d x) \sec (c+d x)}{d (a \cos (c+d x)+a)}\)

\(\Big \downarrow \) 3227

\(\displaystyle \frac {3 a \int \sec ^3(c+d x)dx-2 a \int \sec ^2(c+d x)dx}{a^2}-\frac {\tan (c+d x) \sec (c+d x)}{d (a \cos (c+d x)+a)}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {3 a \int \csc \left (c+d x+\frac {\pi }{2}\right )^3dx-2 a \int \csc \left (c+d x+\frac {\pi }{2}\right )^2dx}{a^2}-\frac {\tan (c+d x) \sec (c+d x)}{d (a \cos (c+d x)+a)}\)

\(\Big \downarrow \) 4254

\(\displaystyle \frac {\frac {2 a \int 1d(-\tan (c+d x))}{d}+3 a \int \csc \left (c+d x+\frac {\pi }{2}\right )^3dx}{a^2}-\frac {\tan (c+d x) \sec (c+d x)}{d (a \cos (c+d x)+a)}\)

\(\Big \downarrow \) 24

\(\displaystyle \frac {3 a \int \csc \left (c+d x+\frac {\pi }{2}\right )^3dx-\frac {2 a \tan (c+d x)}{d}}{a^2}-\frac {\tan (c+d x) \sec (c+d x)}{d (a \cos (c+d x)+a)}\)

\(\Big \downarrow \) 4255

\(\displaystyle \frac {3 a \left (\frac {1}{2} \int \sec (c+d x)dx+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )-\frac {2 a \tan (c+d x)}{d}}{a^2}-\frac {\tan (c+d x) \sec (c+d x)}{d (a \cos (c+d x)+a)}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {3 a \left (\frac {1}{2} \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )-\frac {2 a \tan (c+d x)}{d}}{a^2}-\frac {\tan (c+d x) \sec (c+d x)}{d (a \cos (c+d x)+a)}\)

\(\Big \downarrow \) 4257

\(\displaystyle \frac {3 a \left (\frac {\text {arctanh}(\sin (c+d x))}{2 d}+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )-\frac {2 a \tan (c+d x)}{d}}{a^2}-\frac {\tan (c+d x) \sec (c+d x)}{d (a \cos (c+d x)+a)}\)

input
Int[Sec[c + d*x]^3/(a + a*Cos[c + d*x]),x]
 
output
-((Sec[c + d*x]*Tan[c + d*x])/(d*(a + a*Cos[c + d*x]))) + ((-2*a*Tan[c + d 
*x])/d + 3*a*(ArcTanh[Sin[c + d*x]]/(2*d) + (Sec[c + d*x]*Tan[c + d*x])/(2 
*d)))/a^2
 

3.1.51.3.1 Defintions of rubi rules used

rule 24
Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]
 

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3227
Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x 
_)]), x_Symbol] :> Simp[c   Int[(b*Sin[e + f*x])^m, x], x] + Simp[d/b   Int 
[(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]
 

rule 3247
Int[((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)/((a_) + (b_.)*sin[(e_.) + 
(f_.)*(x_)]), x_Symbol] :> Simp[(-b^2)*Cos[e + f*x]*((c + d*Sin[e + f*x])^( 
n + 1)/(a*f*(b*c - a*d)*(a + b*Sin[e + f*x]))), x] + Simp[d/(a*(b*c - a*d)) 
   Int[(c + d*Sin[e + f*x])^n*(a*n - b*(n + 1)*Sin[e + f*x]), x], x] /; Fre 
eQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[ 
c^2 - d^2, 0] && LtQ[n, 0] && (IntegerQ[2*n] || EqQ[c, 0])
 

rule 4254
Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1)   Subst[Int[Exp 
andIntegrand[(1 + x^2)^(n/2 - 1), x], x], x, Cot[c + d*x]], x] /; FreeQ[{c, 
 d}, x] && IGtQ[n/2, 0]
 

rule 4255
Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* 
x]*((b*Csc[c + d*x])^(n - 1)/(d*(n - 1))), x] + Simp[b^2*((n - 2)/(n - 1)) 
  Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] 
&& IntegerQ[2*n]
 

rule 4257
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] 
 /; FreeQ[{c, d}, x]
 
3.1.51.4 Maple [A] (verified)

Time = 0.99 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.27

method result size
parallelrisch \(\frac {\left (-3 \cos \left (2 d x +2 c \right )-3\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+\left (3 \cos \left (2 d x +2 c \right )+3\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (1+2 \cos \left (2 d x +2 c \right )+\cos \left (d x +c \right )\right )}{2 a d \left (1+\cos \left (2 d x +2 c \right )\right )}\) \(105\)
derivativedivides \(\frac {-\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}+\frac {3}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}-\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2}-\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {3}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2}}{d a}\) \(108\)
default \(\frac {-\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}+\frac {3}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}-\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2}-\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {3}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2}}{d a}\) \(108\)
norman \(\frac {-\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d a}+\frac {5 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}-\frac {\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )}{d a}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 a d}+\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 a d}\) \(114\)
risch \(-\frac {i \left (3 \,{\mathrm e}^{4 i \left (d x +c \right )}+3 \,{\mathrm e}^{3 i \left (d x +c \right )}+5 \,{\mathrm e}^{2 i \left (d x +c \right )}+{\mathrm e}^{i \left (d x +c \right )}+4\right )}{d a \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2} \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 a d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d a}\) \(123\)

input
int(sec(d*x+c)^3/(a+cos(d*x+c)*a),x,method=_RETURNVERBOSE)
 
output
1/2*((-3*cos(2*d*x+2*c)-3)*ln(tan(1/2*d*x+1/2*c)-1)+(3*cos(2*d*x+2*c)+3)*l 
n(tan(1/2*d*x+1/2*c)+1)-2*tan(1/2*d*x+1/2*c)*(1+2*cos(2*d*x+2*c)+cos(d*x+c 
)))/a/d/(1+cos(2*d*x+2*c))
 
3.1.51.5 Fricas [A] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.35 \[ \int \frac {\sec ^3(c+d x)}{a+a \cos (c+d x)} \, dx=\frac {3 \, {\left (\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )^{2}\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (4 \, \cos \left (d x + c\right )^{2} + \cos \left (d x + c\right ) - 1\right )} \sin \left (d x + c\right )}{4 \, {\left (a d \cos \left (d x + c\right )^{3} + a d \cos \left (d x + c\right )^{2}\right )}} \]

input
integrate(sec(d*x+c)^3/(a+a*cos(d*x+c)),x, algorithm="fricas")
 
output
1/4*(3*(cos(d*x + c)^3 + cos(d*x + c)^2)*log(sin(d*x + c) + 1) - 3*(cos(d* 
x + c)^3 + cos(d*x + c)^2)*log(-sin(d*x + c) + 1) - 2*(4*cos(d*x + c)^2 + 
cos(d*x + c) - 1)*sin(d*x + c))/(a*d*cos(d*x + c)^3 + a*d*cos(d*x + c)^2)
 
3.1.51.6 Sympy [F]

\[ \int \frac {\sec ^3(c+d x)}{a+a \cos (c+d x)} \, dx=\frac {\int \frac {\sec ^{3}{\left (c + d x \right )}}{\cos {\left (c + d x \right )} + 1}\, dx}{a} \]

input
integrate(sec(d*x+c)**3/(a+a*cos(d*x+c)),x)
 
output
Integral(sec(c + d*x)**3/(cos(c + d*x) + 1), x)/a
 
3.1.51.7 Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 162 vs. \(2 (79) = 158\).

Time = 0.24 (sec) , antiderivative size = 162, normalized size of antiderivative = 1.95 \[ \int \frac {\sec ^3(c+d x)}{a+a \cos (c+d x)} \, dx=-\frac {\frac {2 \, {\left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {3 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}\right )}}{a - \frac {2 \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} - \frac {3 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a} + \frac {3 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a} + \frac {2 \, \sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}}{2 \, d} \]

input
integrate(sec(d*x+c)^3/(a+a*cos(d*x+c)),x, algorithm="maxima")
 
output
-1/2*(2*(sin(d*x + c)/(cos(d*x + c) + 1) - 3*sin(d*x + c)^3/(cos(d*x + c) 
+ 1)^3)/(a - 2*a*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 + a*sin(d*x + c)^4/(c 
os(d*x + c) + 1)^4) - 3*log(sin(d*x + c)/(cos(d*x + c) + 1) + 1)/a + 3*log 
(sin(d*x + c)/(cos(d*x + c) + 1) - 1)/a + 2*sin(d*x + c)/(a*(cos(d*x + c) 
+ 1)))/d
 
3.1.51.8 Giac [A] (verification not implemented)

Time = 0.32 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.22 \[ \int \frac {\sec ^3(c+d x)}{a+a \cos (c+d x)} \, dx=\frac {\frac {3 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{a} - \frac {3 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{a} - \frac {2 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a} + \frac {2 \, {\left (3 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2} a}}{2 \, d} \]

input
integrate(sec(d*x+c)^3/(a+a*cos(d*x+c)),x, algorithm="giac")
 
output
1/2*(3*log(abs(tan(1/2*d*x + 1/2*c) + 1))/a - 3*log(abs(tan(1/2*d*x + 1/2* 
c) - 1))/a - 2*tan(1/2*d*x + 1/2*c)/a + 2*(3*tan(1/2*d*x + 1/2*c)^3 - tan( 
1/2*d*x + 1/2*c))/((tan(1/2*d*x + 1/2*c)^2 - 1)^2*a))/d
 
3.1.51.9 Mupad [B] (verification not implemented)

Time = 14.76 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.14 \[ \int \frac {\sec ^3(c+d x)}{a+a \cos (c+d x)} \, dx=\frac {3\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a\,d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a\,d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{d\,\left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a\right )} \]

input
int(1/(cos(c + d*x)^3*(a + a*cos(c + d*x))),x)
 
output
(3*atanh(tan(c/2 + (d*x)/2)))/(a*d) - tan(c/2 + (d*x)/2)/(a*d) - (tan(c/2 
+ (d*x)/2) - 3*tan(c/2 + (d*x)/2)^3)/(d*(a - 2*a*tan(c/2 + (d*x)/2)^2 + a* 
tan(c/2 + (d*x)/2)^4))